#include "ForceRegistryManager.h"

#include <utility>

using namespace PHYOgre;
ForceRegistryManager::ForceRegistryManager(void)
	:mRegistrations()
{
}


ForceRegistryManager::~ForceRegistryManager(void)
{
}


void ForceRegistryManager::Add(IntegrableInterface* iEntity, ForceGeneratorInterface* iForceGenearator)
{
	RegistryEntry entry = std::make_pair(iEntity,iForceGenearator);
	mRegistrations[entry] = true ;//.insert(entry,true);
}
void ForceRegistryManager::Remove(const IntegrableInterface* iEntity, const ForceGeneratorInterface* iForceGenearator)
{

}
void ForceRegistryManager::Clear()
{
	mRegistrations.clear();
}

void ForceRegistryManager::UpdateForces(const Real& iDT)
{
	for (Registry::iterator it = mRegistrations.begin(); it != mRegistrations.end(); ++it)
	{
		it->first.second->UpdateForce(it->first.first, iDT);
		//it->second->UpdateForce(it->first, iDT);
	}
}
